package com.lai.note.dao;

import com.lai.note.model.CopyWriting;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface CopyWritingMapper {
    //用户添加新文案，之后管理员审核
    //管理员添加文案
    int addNew(CopyWriting record);

    //根据随机生成的id找文案
    CopyWriting selectByRandomId(int id);

    //获取文案总数量
    int getWritingCount();

    int adminDeleteCopyWriting(@Param("id") int id);

    //用户与文案关联表
    int addNewUserAndCopyWriting(String userId,int writeId);

    int adminDeleteUserAndCopyWriting(int writeId);

    List<CopyWriting> selectUserAllCopyWriting(@Param("userId") String userId);

}
